import { onBeforeUnmount, watch } from 'vue';

export const useWatch = (deps, cb, options) => {
  const stopHandler = watch(deps, cb, options);
  onBeforeUnmount(() => {
    stopHandler && stopHandler();
  });
};
